package com.ruoyi.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.TCwClearingMapper;
import com.ruoyi.domain.TCwClearing;
import com.ruoyi.service.ITCwClearingService;

import javax.annotation.Resource;

/**
 * 结算管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-07
 */
@Service
public class TCwClearingServiceImpl implements ITCwClearingService 
{
    @Resource
    private TCwClearingMapper tCwClearingMapper;

    /**
     * 查询结算管理
     * 
     * @param id 结算管理主键
     * @return 结算管理
     */
    @Override
    public TCwClearing selectTCwClearingById(Long id)
    {
        return tCwClearingMapper.selectTCwClearingById(id);
    }

    /**
     * 查询结算管理列表
     * 
     * @param tCwClearing 结算管理
     * @return 结算管理
     */
    @Override
    public List<TCwClearing> selectTCwClearingList(TCwClearing tCwClearing)
    {
        return tCwClearingMapper.selectTCwClearingList(tCwClearing);
    }

    /**
     * 新增结算管理
     * 
     * @param tCwClearing 结算管理
     * @return 结果
     */
    @Override
    public int insertTCwClearing(TCwClearing tCwClearing)
    {
        tCwClearing.setCreateUserid(1L);
        tCwClearing.setUpdateUserid(1L);
        tCwClearing.setUpdateTime(new Date());
        tCwClearing.setCreateTime(new Date());
        tCwClearing.setCreateTime(DateUtils.getNowDate());
        return tCwClearingMapper.insertTCwClearing(tCwClearing);
    }

    /**
     * 修改结算管理
     * 
     * @param tCwClearing 结算管理
     * @return 结果
     */
    @Override
    public int updateTCwClearing(TCwClearing tCwClearing)
    {
        tCwClearing.setUpdateTime(DateUtils.getNowDate());
        return tCwClearingMapper.updateTCwClearing(tCwClearing);
    }

    /**
     * 批量删除结算管理
     * 
     * @param ids 需要删除的结算管理主键
     * @return 结果
     */
    @Override
    public int deleteTCwClearingByIds(Long[] ids)
    {
        return tCwClearingMapper.deleteTCwClearingByIds(ids);
    }

    /**
     * 删除结算管理信息
     * 
     * @param id 结算管理主键
     * @return 结果
     */
    @Override
    public int deleteTCwClearingById(Long id)
    {
        return tCwClearingMapper.deleteTCwClearingById(id);
    }

    @Override
    public int updateTCwClearings(Integer[] id) {
        return tCwClearingMapper.updateTCwClearings(id);
    }
}
